package com.tb.ClassSchedule;

import java.io.Serializable;

/**
 * Created by 汪贵春 on 2016/7/20.
 */
public class Lesson implements Serializable{

    private String name;
    private int    weekday;
    private int    startSection;
    private int    endSection;
    private int    startWeek;
    private int    endWeek;
    private String teacher;
    private String address;
    private int rowSpan;


    public Lesson(){
        this.name = " ";
        this.weekday = 0;
        this.startSection = 0;
        this.endSection = 0;
        this.startWeek = 0;
        this.endWeek = 20;
        this.teacher = " ";
        this.address = " ";
        this.rowSpan = 1;
    }

    public Lesson(String name,int rowSpan){
        this.name = name;
        this.weekday = 0;
        this.startSection = 0;
        this.endSection = 0;
        this.startWeek = 0;
        this.endWeek = 20;
        this.teacher = " ";
        this.address = " ";
        this.rowSpan = rowSpan;
    }

    public Lesson(String name,
                  int weekday,
                  int startSection,
                  int endSection,
                  int startWeek,
                  int endWeek,
                  String teacher,
                  String address) {
        this.name = name;
        this.address = address;
        this.teacher = teacher;
        this.startWeek = startWeek;
        this.endWeek = endWeek;
        this.weekday = weekday;
        this.startSection = startSection;
        this.endSection = endSection;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTeacher() {
        return teacher;
    }

    public void setTeacher(String teacher) {
        this.teacher = teacher;
    }

    public int getStartWeek() {
        return startWeek;
    }

    public void setStartWeek(int startWeek) {
        this.startWeek = startWeek;
    }

    public int getEndWeek() {
        return endWeek;
    }

    public void setEndWeek(int endWeek) {
        this.endWeek = endWeek;
    }

    public int getWeekday() {
        return weekday;
    }

    public void setWeekday(int weekday) {
        this.weekday = weekday;
    }

    public int getStartSection() {
        return startSection;
    }

    public void setStartSection(int startSection) {
        this.startSection = startSection;
    }

    public int getEndSection() {
        return endSection;
    }

    public void setEndSection(int endSection) {
        this.endSection = endSection;
    }

    public int getRowSpan() {
        return getEndSection() - getStartSection() + 1;
    }

    public void setRowSpan(int rowSpan) {
        this.endSection = rowSpan - 1 + getStartSection();
    }
}
